home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Leonardo the Inventor
/
Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso
/
LEOWINMV
/
FORTGAME.DIR
/
00217_Script_217
< prev
next >
Wrap
Text File
|
1996-03-20
|
13KB
|
477 lines
-- FLEE THE FORTRESS --
-- Lingo by Ephraim Tabackman--
-- Revision June 15, 1994 --
-- Fixed problems with cursors --
on begin
goFirstLevel
--goSecondlevel
--goThirdlevel
end begin
on startMovie
set the cursor of sprite 1 = -1
-- recordSpots -- òòòòò
-- resetGame
end startMovie
on stopMovie
noPuppets
when keyDown then nothing
--global theList -- òòòòò
--put theList -- òòòòò
end stopMovie
on noPuppets
repeat with S = 1 to 24
puppetSprite S, false
end repeat
end noPuppets
on emptyCastNumber
return the number of cast "itemEmpty"
end emptyCastNumber
-- CURSORS:
-- 128: Backward
-- 129: Left
-- 130: Right
-- 131: Forward
-- 132: Point
-- 133: Hand
-- 134: Magnify
-- 135: Fist
on resetGame
noPuppets
put field "Default Doors Data" into field "Doors Data"
global BGSoundFile
set BGSoundFile = the pathName & "FG_BG.AIF"
-- set BGSoundFile = "LEONARDO:LEOWINMV:FG_BG.AIF"
global hallBackwardSprite, hallForwardSprite,openDoorSprite,enterDoorSprite,closeDoorSprite,roomBackwardSprite
set hallBackwardSprite = 8
set hallForwardSprite = 9
set openDoorSprite = 11
set enterDoorSprite = 11
set closeDoorSprite = 12
set roomBackwardSprite = 11
global hallBackwardCursor, hallForwardCursor,openDoorCursor,enterDoorCursor,closeDoorCursor,roomBackwardCursor,grabObjectCursor
set hallBackwardCursor = [the number of cast "129Cursor", the number of cast "129Mask"]
set hallForwardCursor = [the number of cast "130Cursor", the number of cast "130Mask"]
set openDoorCursor = [the number of cast "135Cursor", the number of cast "135Mask"]
set enterDoorCursor = [the number of cast "131Cursor", the number of cast "131Mask"]
set closeDoorCursor = [the number of cast "133Cursor", the number of cast "133Mask"]
set roomBackwardCursor = [the number of cast "128Cursor", the number of cast "128Mask"]
set grabObjectCursor = [the number of cast "133Cursor", the number of cast "133Mask"]
global PlayViolaCursor
set PlayViolaCursor = [the number of cast "132Cursor", the number of cast "132Mask"]
global sceneSprite, roomNumberSprite
set sceneSprite = 3
set roomNumberSprite = 4
global mapSprite, mapMarkerSprite
set mapSprite = 13
set mapMarkerSprite = 14
puppetSprite mapMarkerSprite, true
global mapScale
set mapScale = 4
resetInventory
global objectChannel1, objectChannel2
set objectChannel1 = 5
set objectChannel2 = 6
------------------------------------- OBJECT FLAGS
global BackwardNoteTaken, BackwardNoteSprite
set BackwardNoteTaken = false
set BackwardNoteSprite = objectChannel1
global MusicClue1Taken, MusicClue2Taken, MusicClueSprite
set MusicClue1Taken = false
set MusicClue2Taken = false
set MusicClueSprite = objectChannel1
global Snorkel1Taken, Snorkel1Sprite
set Snorkel1Taken = false
set Snorkel1Sprite = objectChannel1
global Key1Taken, Key2Taken, Key3Taken, Key4Taken, KeySprite
set Key1Taken = false
set Key2Taken = false
set Key3Taken = false
set Key4Taken = false
set KeySprite = objectChannel1
global drawBridgeDoorOpen, drawBridgeDoorSprite
set drawBridgeDoorOpen = false
set drawBridgeDoorSprite = objectChannel1
global drawBridgeHandleSprite
set drawBridgeHandleSprite = objectChannel1
global TrunkOpen, trunkSprite
set trunkOpen = false
set trunkSprite = ObjectChannel1
----------------------------------------------------
global NumPositionsA, NumPositionsB, NumPositionsC, NumPositionsR
global LastDoorA, LastDoorB, LastDoorC
set NumPositionsA = 16
set NumPositionsB = 32
set NumPositionsC = 48
set NumPositionsR = 24
set LastDoorA = 4
set LastDoorB = 12
set LastDoorC = 24
begin
end resetGame
on resetInventory
global item1Sprite, item2Sprite, item3Sprite
set item1Sprite = 15
set item2Sprite = 16
set item3Sprite = 17
puppetSprite item1Sprite, true
puppetSprite item2Sprite, true
puppetSprite item3Sprite, true
global grabObjectCursor
set the castNum of sprite item1Sprite to emptyCastNumber()
set the castNum of sprite item2Sprite to emptyCastNumber()
set the castNum of sprite item3Sprite to emptyCastNumber()
resetSpriteCursor item1Sprite
resetSpriteCursor item2Sprite
resetSpriteCursor item3Sprite
global item1Name, item2Name, item3Name
set item1Name = empty
set item2Name = empty
set item3Name = empty
end resetInventory
on restoreInventory
global item1Sprite, item2Sprite, item3Sprite
global item1Name, item2Name, item3Name
puppetSprite item1Sprite, true
puppetSprite item2Sprite, true
puppetSprite item3Sprite, true
set the castNum of sprite item1Sprite to the number of cast item1Name
set the castNum of sprite item2Sprite to the number of cast item2Name
set the castNum of sprite item3Sprite to the number of cast item3Name
end restoreInventory
on resetCursors
global hallBackwardSprite, hallForwardSprite,openDoorSprite,closeDoorSprite,roomBackwardSprite
set the cursor of sprite hallBackwardSprite = -1
set the cursor of sprite hallBackwardSprite = 0
set the cursor of sprite hallForwardSprite = -1
set the cursor of sprite hallForwardSprite = 0
set the cursor of sprite openDoorSprite = -1
set the cursor of sprite openDoorSprite = 0
set the cursor of sprite closeDoorSprite = -1
set the cursor of sprite closeDoorSprite = 0
set the cursor of sprite roomBackwardSprite = -1
set the cursor of sprite roomBackwardSprite = 0
end resetCursors
on setGrabObjectCursor WhichSprite
global grabObjectCursor
set the cursor of sprite WhichSprite = grabObjectCursor
end setGrabObjectCursor
on resetSpriteCursor whichSprite
set the cursor of sprite WhichSprite = -1
end resetSpriteCursor
on goFirstLevel
global currentList, CurrentListLine
set currentList = "A"
set CurrentListLine = 2
moveInHall 0 -- go to the start position
when keyDown then checkKeyCode
end goFirstLevel
on goSecondLevel
resetInventory
global currentList, CurrentListLine
set currentList = "B"
set CurrentListLine = 10
moveInHall 0 -- go to the start position
when keyDown then checkKeyCode
end goSecondLevel
on goThirdLevel
resetInventory
global currentList, CurrentListLine
set currentList = "C"
set CurrentListLine = 1
moveInHall 0 -- go to the start position
when keyDown then checkKeyCode
end goThirdLevel
on checkKeyCode
put the keyCode into userKeyCode
if userKeyCode = 123 then
moveBackward
dontPassEvent
else if userKeyCode = 124 then
moveForward
dontPassEvent
else if userKeyCode = 125 then
moveBackward
dontPassEvent
else if userKeyCode = 126 then
moveForward
dontPassEvent
end if
end checkKeyCode
on clickNearDoor
global currentList, CurrentListLine
clickDoor getNearRoomNumber()
end clickNearDoor
on ClickToCloseDoor
CloseDoor getNearRoomNumber()
global closeDoorSprite
set the cursor of sprite closeDoorSprite = -1
puppetSound "Slam"
moveInHall 0
waitSound
end ClickToCloseDoor
on moveForward
global currentList, currentListLine
if currentList = "R" then
BumpSound
else
moveInHall +1
end if
end moveForward
on moveBackward
global currentList
if currentList = "R" then
exitRoom
else
moveInHall -1
end if
end moveBackward
on getDoorOpenStatus whichRoom
return item 3 of line whichRoom of the text of cast "Doors Data"
end getDoorLockStatus
on clickDoor whichRoom
put the text of cast "Doors Data" into DoorsData
put line whichRoom of DoorsData into thisDoor
put item 1 of thisDoor into Lock_Status
put item 2 of thisDoor into KeyName
put item 3 of thisDoor into Open_Status
if Open_Status = "Open" then
enterRoom whichRoom
exit
end if
if Lock_Status = "Unlocked" then
OpenDoor whichRoom
exit
end if
if Lock_Status = "Locked" then
rPlaySoundAndWait "Locked"
end if
end clickDoor
on setDoorOpenStatus whichDoor, openOrClosed
put openOrClosed into item 3 of line whichDoor of field "Doors Data"
end setDoorOpenStatus
on setDoorLockedStatus whichDoor, lockedOrUnlocked
put lockedOrUnlocked into item 1 of line whichDoor of field "Doors Data"
end setDoorLockedStatus
on unlockDoor whichDoor
setDoorLockedStatus whichDoor, "Unlocked"
end unlockDoor
on OpenDoor whichRoom
setDoorOpenStatus whichRoom, "Open"
global roomNumberSprite
puppetSprite roomNumberSprite, true
go frame "OpenDoor"
global enterDoorSprite, enterDoorCursor, closeDoorSprite, closeDoorCursor
set the cursor of sprite enterDoorSprite = enterDoorCursor
set the cursor of sprite closeDoorSprite = closeDoorCursor
end OpenDoor
on CloseDoor whichRoom
setDoorOpenStatus whichRoom, "Closed"
global roomNumberSprite
puppetSprite roomNumberSprite, false
end CloseDoor
on doorAlreadyClosed
go frame "DoorOpen"
global enterDoorSprite, enterDoorCursor, closeDoorSprite, closeDoorCursor
set the cursor of sprite enterDoorSprite = enterDoorCursor
set the cursor of sprite closeDoorSprite = closeDoorCursor
end doorAlreadyClosed
on enterRoom whichRoom
global currentList, CurrentListLine
global lastHallList, lastHallListLine
set lastHallList = currentList
set lastHallListLine = CurrentListLine
set currentList = "R"
set currentListLine = whichRoom
puppetTransition 9, 2, 8, true -- center out square
setUpRoom
end enterRoom
on setUpRoom
global currentList, CurrentListLine
resetCursors
setUpObjects currentList&¤tListLine
global roomBackwardSprite, roomBackwardCursor
set the cursor of sprite roomBackwardSprite = roomBackwardCursor
UpdatePosition
end setUpRoom
on exitRoom
global currentList, CurrentListLine
global lastHallList, lastHallListLine
set currentList = lastHallList
set currentListLine = lastHallListLine
puppetTransition 10, 2, 8, true -- edges in square
moveInHall 0
end exitRoom
on moveInHall amount
global currentList, CurrentListLine
global NumPositionsA, NumPositionsB, NumPositionsC
global LastDoorA, LastDoorB, LastDoorC
if currentList = "A" then put NumPositionsA into posMax
else if currentList = "B" then put NumPositionsB into posMax
else if currentList = "C" then put NumPositionsC into posMax
set nextLine = CurrentListLine + amount
if nextLine > posMax then set nextLine = 1
else if nextLine < 1 then set nextLine = posMax
set CurrentListLine = nextLine
resetCursors
global hallBackwardSprite, hallForwardSprite
global hallBackwardCursor, hallForwardCursor
set the cursor of sprite hallBackwardSprite = hallBackwardCursor
set the cursor of sprite hallForwardSprite = hallForwardCursor
UpdatePosition
end moveInHall
on UpdatePosition
global currentList, CurrentListLine
GoToPosition getFrameFromListLine(currentList, CurrentListLine)
end GoToCurrentPosition
on GoToPosition whichPos
global openDoorSprite, openDoorCursor
if not (whichPos contains "-" or whichPos contains "+" or whichPos contains "D" or whichPos contains "R") then go frame "Hall"
else if (whichPos contains "D") and (getDoorOpenStatus (getNearRoomNumber()) = "Open") then doorAlreadyClosed
else
go frame whichPos
if (whichPos contains "D") then set the cursor of sprite openDoorSprite = openDoorCursor
end if
put whichPos into field "Position"
updateMap
global BGSoundFile
if whichPos = "R 21" then sound stop 2
else
if not soundBusy(2) then sound playFile 2, BGSoundFile
end if
updateStage
end GoToPosition
on getNearRoomNumber
global currentList, CurrentListLine
return integer(value(word 2 of getFrameFromListLine(currentList, CurrentListLine)))
end getNearRoomNumber
on getFarRoomNumber
global currentList, CurrentListLine
return (word 3 of getFrameFromListLine(currentList, CurrentListLine))
end getFarRoomNumber
on getFrameFromListLine aList, aListLine
put value(aListLine) into aListLine
return item 1 of line aListLine of field ("List"&aList)
end getFrameFromListline
on getMapCoordsFromListLine aList, aListLine
put value(aListLine) into aListLine
return item 2 of line aListLine of field ("List"&aList)
end getMapCoordsFromListLine
on updateMap
global currentList, CurrentListLine
global mapMarkerSprite, mapSprite, mapScale
set newCoord = getMapCoordsFromListLine (currentList, CurrentListLine)
set newV = integer ((word 2 of newCoord * mapScale) + the locV of sprite mapSprite)
set newH = integer ((word 1 of newCoord * mapScale) + the locH of sprite mapSprite)
set the locV of sprite mapMarkerSprite = newV
set the locH of sprite mapMarkerSprite = newH
end updateMap
--------------------------------------------------------------------------
on hideSprite whichSprite, bUpdate
puppetSprite whichSprite, true
set the locV of sprite whichSprite = -3000
if bUpdate then updateStage
end hideSprite
on WaitTicks howMany
put the ticks into startTicks
repeat while the ticks < startTicks + howMany
end repeat
end WaitTicks